package states.loading;

import org.newdawn.slick.Color;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.StateBasedGame;
import org.newdawn.slick.state.transition.FadeInTransition;
import org.newdawn.slick.state.transition.FadeOutTransition;

import resources.ResourceManager;
import states.States;
import states.mainmenu.MainMenuGameState;

public class BuildGameAfterLoading implements IAfterLoading {

	private ResourceManager _rm;
	
	public BuildGameAfterLoading(ResourceManager rm){
		_rm = rm;
	}
	
	@Override
	public void execute(GameContainer gc, StateBasedGame sbg) throws SlickException {

//		ShaporFactory factory = new ShaporFactory(_rm);
//		
//		// Base
//		Image base =  _rm.getImage(Assets.ACTOR_BASE.getId());
//		base.setCenterOfRotation(base.getWidth()/2, base.getHeight()/2);
//		Player player = new Player(20, new Position(3, 3), factory.generateBase());
//		
//		List<EnemyCreepGenerator> generators = new ArrayList<EnemyCreepGenerator>();
//		generators.add(factory.getEnemyCreepGenerator());
//		generators.add(factory.getEnemyCreepGenerator());
//		generators.add(factory.getEnemyCreepGenerator());
//		
//		List<Position> positions = new ArrayList<Position>();
//		positions.add(new Position(8, 34));
//		positions.add(new Position(30, 25));
//		positions.add(new Position(45, 20));
//		
//		Enemy enemy = new Enemy(generators, positions);
		
//		GameplayState dgs = (GameplayState) sbg.getState(States.MISSION_STATE_ID);
//		dgs.initStateForGameplay(player, enemy);
//		sbg.enterState(States.MISSION_STATE_ID, new FadeOutTransition(Color.black, 1000), new FadeInTransition(Color.black, 1000));
		
		MainMenuGameState mm = (MainMenuGameState) sbg.getState(States.MAIN_MENU_ID);
		sbg.enterState(States.MAIN_MENU_ID, new FadeOutTransition(Color.black, 1000), new FadeInTransition(Color.black, 1000));
	}

}